package com.share.openfeign;

import com.share.constants.AllConsts;
import com.share.domain.RuleVo;
import com.share.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import javax.validation.Valid;

@FeignClient(value =  AllConsts.Remote.SERVICE_NAME_RULE,
        fallbackFactory = RuleOpenfeignFallbackFactory.class)
public interface RuleOpenfeign {
    @PostMapping(AllConsts.Remote.REMOTE_PREFLIX_RULE)
    public JSONResult pricing(@RequestBody @Valid RuleVo ruleVo);

    @GetMapping(AllConsts.Remote.REMOTE_PREFLIX_RULE+AllConsts.Remote.BASE_FEE)
    public JSONResult baseFee();
}
